package com.codez.unionpay.elasticjob;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

import lombok.extern.slf4j.Slf4j;

/**
 * @author zhengdechao
 * @createTime : 2019-06-13
 *
 */

@Slf4j
public class MySimpleJob implements SimpleJob {

	@Override
	public void execute(ShardingContext shardingContext) {
//		log.info(String.format("------Thread ID: %s, 任务总片数: %s, 当前分片项: %s",
//			Thread.currentThread().getId(), shardingContext.getShardingTotalCount(),
//			shardingContext.getShardingItem()));
		int item = shardingContext.getShardingItem();
		log.info("我是第{}名",item==0?"1":item==1?"2":item==2?"3":"4");
		log.info(shardingContext.getShardingParameter()+ "-- " +shardingContext.getJobParameter());
	}

}
